package com.itheima.test;

import java.util.Scanner;

/**
 * @Author 王加鑫
 * @Date 2021/4/19 10:03
 * @Version 1.0
 * 键盘录入月份,显示季节
 * 采用case穿透原理
 */
public class SwitchTest03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入月数:");
        int month = sc.nextInt();
        switch (month){
            case 12:
            case 1:
            case 2:
                System.out.println("冬季");
                break;
            case 3:
            case 4:
            case 5:
                System.out.println("春季");
                break;
            case 6:
            case 7:
            case 8:
                System.out.println("夏季");
                break;
            case 9:
            case 10:
            case 11:
                System.out.println("秋季");
                break;
            default:
                System.out.println("您输入有误");
                break;
        }
    }
}
